package com.icreate.storm.methods.indicators;

import clojure.lang.IFn;
import com.icreate.storm.methods.common.DateMethod;
import org.apache.storm.tuple.Values;

import java.util.function.ObjLongConsumer;

/**
 * Created by hadoop on 17-5-3.
 */
public abstract class BaseIndicator implements Indicator {

    public abstract String[] getFields();

    public abstract Values getValues(Object s);

    protected long getValue(String str) {
        long defaultValue = 0L;
        if (str.equals("") || str == null) return defaultValue;
        try {
            return Integer.parseInt(str);
        } catch (NumberFormatException x) {
            return defaultValue;
        }
    }

    protected long getCount(String str) {
        if (str.equals("") || str == null)
            return 0;
        else
            return 1;
    }

}
